%% nii_quickread.m

% reads in a nii.gz file and converts it froma volume to a matrix.

% mat = nii_quickread(fname,spat_res)

% fname is input file name (inc. path).
% spat_res in the resolution of the volume in mm.
% mat is the 2D matrix output

function mat = nii_quickread(fname,spat_res)

global OSLDIR;
stdbrain=read_avw([OSLDIR '/std_masks/MNI152_T1_' num2str(spat_res) 'mm_brain.nii.gz']);
mat=vols2matrix(read_avw(fname),stdbrain);

end
